/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/layout'

const maintenanceRouter = {
  path: '/maintenance',
  component: Layout,
  redirect: '/maintenance/account/user',
  name: 'Maintenance',
  meta: {
    title: 'maintenanceControl',
    icon: 'maintenance',
    roles: ['admin']
  },
  children: [
    {
      path: 'organization',
      name: 'organization',
      component: () => import('@/views/organization/index'),
      meta: { title: 'organization', icon: 'tree' }
    },
    {
      path: 'account',
      component: () => import('@/views/maintenance/account/index'), // Parent router-view
      name: 'Account',
      meta: { title: 'accountControl', icon: 'peoples' },
      redirect: '/maintenance/account/user',
      children: [
        {
          path: 'user',
          component: () => import('@/views/maintenance/account/user'),
          name: 'userControl',
          meta: { title: 'userControl' }
        },
        {
          path: 'role',
          component: () => import('@/views/maintenance/account/role'),
          name: 'rolesControl',
          meta: { title: 'rolesControl' }
        },
      ]
    },
    {
      path: 'device',
      name: 'deviceControl',
      component: () => import('@/views/maintenance/device/index'),
      name: 'Device',
      meta: { title: 'deviceControl', icon: 'device' },
      redirect: 'noRedirect',
      // redirect: '/maintenance/device/handheld',
      children: [
        {
          path: 'handheld',
          component: () => import('@/views/maintenance/device/handheld'),
          name: 'handheld',
          meta: { title: 'handheld' }
        },
        {
          path: 'position',
          component: () => import('@/views/maintenance/device/position'),
          name: 'position',
          meta: { title: 'position' }
        },
        {
          path: 'onboard',
          component: () => import('@/views/maintenance/device/onboard'),
          name: 'onboard',
          meta: { title: 'onboard' }
        }
      ]
    },
    {
      path: 'group',
      name: 'group',
      component: () => import('@/views/maintenance/group/index'),
      meta: { title: 'groupControl', icon: 'group' }
    },
    {
      path: 'train',
      name: 'train',
      component: () => import('@/views/maintenance/train/index'),
      meta: { title: 'trainControl', icon: 'train' }
    },
    {
      path: 'update',
      name: 'Update',
      component: () => import('@/views/maintenance/apk'),
      meta: { title: 'update', icon: 'version' ,
      },
      children: [
        {
          path: 'apk',
          name: 'apk',
          component: () => import('@/views/maintenance/apk'),
          meta: { title: 'apk' }
        },
      ]
    },

    {
      path: 'systemState',
      name: 'systemState',
      component: () => import('@/views/maintenance/systemState/index'),
      redirect: '/maintenance/systemState/STPStation',
      meta: { title: 'systemState', icon: 'system' },
      children: [
        {
          path: 'STPStation',
          component: () => import('@/views/maintenance/systemState/STPStation'),
          name: 'STPStation',
          meta: { title: 'STPStation' }
        },
        {
          path: 'serverLink',
          component: () => import('@/views/maintenance/systemState/serverLink'),
          name: 'serverLink',
          meta: { title: 'serverLink' }
        },

      ]
    },



  ]
}

export default maintenanceRouter



  //   path: '/serverLink',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/serverLink/index'),
  //       name: 'serverLink',
  //       meta: { title: 'serverLink', icon: 'serverLink', roles: ['admin'] }
  //     }
  //   ]
  // },
  // {
  //   path: '/STPStation',
  //   component: Layout,
  //   children: [
  //     {
  //       path: 'index',
  //       component: () => import('@/views/STPStation/index'),
  //       name: 'STPStation',
  //       meta: { title: 'STPStation', icon: 'STPStation', roles: ['admin'] }
  //     }
  //   ]
  // },